﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace huqiang.Communication
{
    public class OutLog
    {
        public static Action<string> Log;
        public static Action<KcpUser, string> Log2;
        public static void WriteLine(object obj)
        {
            if (Log != null)
                Log(obj.ToString());
            else System.Diagnostics.Debug.WriteLine(obj);
        }
        public static void WriteLine(KcpUser user, object obj)
        {
            if (Log2 != null)
                Log2(user,obj.ToString());
            else System.Diagnostics.Debug.WriteLine(obj);
        }
        public static void WriteLine(string str)
        {
            if (Log != null)
                Log( str);
            else System.Diagnostics.Debug.WriteLine(str);
        }
        public static void WriteLine(KcpUser user, string str)
        {
            if (Log2 != null)
                Log2(user,str);
            else System.Diagnostics.Debug.WriteLine(str);
        }
        public static void Write(string str)
        {
            if (Log != null)
                Log(str);
            else System.Diagnostics.Debug.Write(str);
        }
        public static void Write(KcpUser user, string str)
        {
            if (Log2 != null)
                Log2(user,str);
            else System.Diagnostics.Debug.Write(str);
        }
    }
}
